home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / misc / egs.lha / EGS / EGS_Devels / Examples / EGS_Requester / makegadget.c < prev    next >
Text File  |  1993-02-16  |  2KB  |  79 lines

  1. /**
  2.  **  Author: mvk
  3.  **    Date: 18. Dezember 1992
  4.  **          09 Jan 1993 mvk
  5.  **
  6.  **  (C) by  VIONA-Development 1991,1993
  7.  **
  8.  **  Create some Gadgets
  9.  **
  10.  **/
  11.  
  12. EB_StrArray     text =
  13. {
  14.     "HHH & MVK Alpha-Version",
  15.     "from 09 Jan 1993 for Demo",
  16.     "© by VIONA Development", NULL};
  17.  
  18. EB_StrArray     Gads1 =
  19. {"Record", "Play", "Load", "Save", NULL};
  20. EB_StrArray2    Gadgs =
  21. {&Gads1, NULL};
  22.  
  23.  
  24. EI_WindowPtr
  25. CreateGads(EI_WindowPtr win)
  26. {
  27.     EB_GadBoxPtr box, root, help;
  28.  
  29.     con = EB_CreateGadContext(NULL, NULL, -1, -1);
  30.  
  31.     if (con == NULL)
  32.         return (NULL);
  33.  
  34.     box = EB_CreateMaster(con, 0, 0);
  35.  
  36.     if (box == NULL)
  37.         return (NULL);
  38.  
  39.     help = EB_CreateHorizBox(con);
  40.  
  41.     EB_AddLastSon(help, EB_CreateHorizFill(con, 0, 0));
  42.     EB_AddLastSon(help, EB_CreateMultiAction2(con, &Gadgs, 0x1000));
  43.     EB_AddLastSon(help, EB_CreateHorizFill(con, 0, 0));
  44.  
  45.     root = EB_CreateVertiBox(con);
  46.  
  47.     if (root == NULL)
  48.         return (NULL);
  49.  
  50.     EB_AddLastSon(root, EB_CreateMultiText(con, &text));
  51.  
  52.     EB_AddLastSon(root, help);
  53.  
  54.     EB_AddLastSon(box, root);
  55.  
  56.     root = EB_CreateMasterWindow(con, win, box);
  57.  
  58.     if (EB_ProcessGadBoxes(con, root))
  59.     {
  60.         if (win == NULL)
  61.         {
  62.             con->NewWin->IDCMPFlags = myEdcmpFlags;
  63.             con->NewWin->Title = "REQUESTER DEMO";
  64.  
  65.             con->NewWin->Flags |= myWinFlags;
  66.             con->NewWin->Bordef.SysGadgets = myWinGads;
  67.             con->NewWin->MaxWidth = 800;
  68.             con->NewWin->MaxHeight = 600;
  69.  
  70.             return (EI_WindowPtr) EI_OpenWindow(con->NewWin);
  71.         }
  72.         else
  73.             return win;
  74.     }
  75.     else
  76.         return NULL;
  77.  
  78. }
  79.